﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NHibernate;
using CNRegex.Entity;
using CNRegex.Biz.BizAccess;
using CNRegex.Web;
using CNRegex.Biz;
using CNRegex.Web.Utility;
using CNRegex.Web.Utility;

namespace CNRegex.Web.Base
{
	public abstract class BaseModel
	{
		private BizRegexCategory bizRegexCategory;
		private BizRegexUserBlogCatalog bizRegexUserBlogCatalog;

		public  BaseModel()
		{
			bizRegexCategory =BizFactory.Get<BizRegexCategory>();
			bizRegexUserBlogCatalog = BizFactory.Get<BizRegexUserBlogCatalog>();
			InjectBizObject.Inject(this);
		}

		/// <summary>
		/// 导出对象
		/// </summary>
		public Export ExportObject
		{
			get;
			set;
		}

		/// <summary>
		/// Count
		/// </summary>
		protected int count;

		/// <summary>
		/// 分页索引
		/// </summary>
		public int? PageIndex
		{
			get;
			set;
		}

		/// <summary>
		/// 分页对象
		/// </summary>
		public PaginateHelper PaginateHelperObject
		{
			get;
			set;
		}

		private IList<RegexCategory> regexCategories;
		public IList<RegexCategory> RegexCategories
		{
			get
			{
				if (regexCategories != null)
					return regexCategories;
				regexCategories = bizRegexCategory.List();
				return regexCategories;
			}
		}

		private IList<RegexUserBlogCatalog> regexUserBlogCataloies;
		public IList<RegexUserBlogCatalog> RegexUserBlogCataloies
		{
			get
			{
				if (regexUserBlogCataloies != null)
					return regexUserBlogCataloies;
				regexUserBlogCataloies = bizRegexUserBlogCatalog.List();
				return regexUserBlogCataloies;
				
			}
		}
	}
}